<?php
session_start();
header("Content-Type:text/html;charset=utf-8"); 

//echo $_SESSION['username'];

if(!isset($_SESSION['username']))
{
    header("location: login.html");
}
else
{
  
  
    $mysql = new SaeMysql();



$sql = "SELECT * FROM dan";
$result = $mysql->getData( $sql );

echo "<h3>DanDan</h3>";
if(count($result)>0){
    
    for($i=0;$i<count($result);$i++){
        echo "<div class='thumbnail'>";
        echo "<div class='row'>";
        echo "<div class='col-xs-6'>";
        

        echo "<h4>".($i+1)."</h4>";
        echo "<h1>".$result[$i]['name']."</h1>";
        echo "<h5>".$result[$i]['gender']."</h5>";
        echo "<h5>".$result[$i]['telephone']."</h5>";
        echo "<h5>".$result[$i]['work']."</h5>";
        
        echo "</div>";
        echo "</div>";
        echo "</div>";
     }
     
  }


if ($mysql->errno() != 0)
{
    die("Error:" . $mysql->errmsg());
}

$mysql->closeDb();

    
}
?>

<html>
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link href="http://cdn.bootcss.com/highlight.js/7.3/styles/github.min.css" rel="stylesheet">
    <link rel="stylesheet" href="http://cdn.bootcss.com/twitter-bootstrap/3.0.2/css/bootstrap.min.css">
   
</html>
